Skip to content

Davidgu/bug projectanalyticsconfigmodalbeingfinicky - #67

Merged
llam36 merged 12 commits into
mainfrom
davidgu/bug_projectanalyticsconfigmodalbeingfinicky
Apr 13, 2026
Merged

Davidgu/bug projectanalyticsconfigmodalbeingfinicky#67
llam36 merged 12 commits into
mainfrom
davidgu/bug_projectanalyticsconfigmodalbeingfinicky

Conversation

@shaply

@shaply shaply commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

closes #43

Reproduction Steps

  1. Navigate to http://localhost:3000/admin/users
  2. Attempt to edit a user and set the role. In some scenarios, when hitting "Edit User" the context menu will disappear and fail to register the click.

Requirements

  • Modal actions should not result in a UI flicker
Screen.Recording.2026-02-07.at.5.20.44.PM.mov

@netlify

netlify Bot commented Feb 7, 2026

Copy link
Copy Markdown

Deploy Preview for juno-dashboard failed. Why did it fail? →

Name Link
🔨 Latest commit 13ac0f4
🔍 Latest deploy log https://app.netlify.com/projects/juno-dashboard/deploys/6987bd3356e2970008ff1ffd

@shaply
shaply requested a review from llam36 February 7, 2026 22:22
@greptile-apps

greptile-apps Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Fixed modal flickering issue in analytics config editor by decoupling Dialog and DropdownMenu state management. Also added defensive null checks for project lookups in EditUserForm.

Key Changes:

  • Removed DialogTrigger from dropdown and added explicit state management with useState for dialog visibility
  • Moved Dialog component outside of DropdownMenu hierarchy to prevent modal interactions
  • Added null checks before calling linkUserToProject and unlinkUserFromProject to prevent crashes when project is not found
  • Filtered out null promises from project link/unlink operations

Issues Found:

  • console.error statements added violate code standards requiring no console logs in production code

Confidence Score: 4/5

  • Safe to merge after removing console.error statements
  • The core bug fix is solid and follows the existing pattern used in user-actions-cell.tsx. The defensive null checks improve robustness. However, two console.error statements violate code standards and must be removed before merging.
  • src/components/forms/EditUserForm.tsx requires removal of console.error statements on lines 108 and 125

Important Files Changed

Filename Overview
src/components/analyticsConfigTable/analytics-action-cell.tsx Refactored to manage dialog state externally instead of using DialogTrigger - fixes modal flickering issue by preventing dropdown from closing when dialog opens
src/components/forms/EditUserForm.tsx Added null checks for projectName before API calls and console.error logging, but console statements violate code standards

Sequence Diagram

sequenceDiagram
    participant User
    participant DropdownMenu
    participant AnalyticsActionsCell
    participant Dialog
    participant AddAnalyticsConfigForm

    User->>DropdownMenu: Click more actions button
    DropdownMenu->>User: Show dropdown menu
    User->>DropdownMenu: Click "Edit config"
    DropdownMenu->>AnalyticsActionsCell: onClick handler fires
    AnalyticsActionsCell->>AnalyticsActionsCell: setIsDialogOpen(true)
    AnalyticsActionsCell->>Dialog: Update open prop
    Dialog->>User: Display modal with form
    User->>AddAnalyticsConfigForm: Edit configuration
    AddAnalyticsConfigForm->>AnalyticsActionsCell: onUpdateConfig callback
    AnalyticsActionsCell->>Dialog: setIsDialogOpen(false)
    Dialog->>User: Close modal
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/components/forms/EditUserForm.tsx Outdated
Comment thread src/components/forms/EditUserForm.tsx Outdated
@netlify

netlify Bot commented Feb 24, 2026

Copy link
Copy Markdown

Deploy Preview for juno-dashboard failed. Why did it fail? →

Name Link
🔨 Latest commit 13524c4
🔍 Latest deploy log https://app.netlify.com/projects/juno-dashboard/deploys/699d2252c6ea0d0008bc4cd0

@netlify

netlify Bot commented Apr 13, 2026

Copy link
Copy Markdown

Deploy Preview for juno-dashboard failed. Why did it fail? →

Name Link
🔨 Latest commit 3d134e8
🔍 Latest deploy log https://app.netlify.com/projects/juno-dashboard/deploys/69dc558f235c590008f97ad8

@llam36
llam36 merged commit a3b1041 into main Apr 13, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modals sometimes being finniky with registering mouse events

2 participants